Optimal. Leaf size=226 \[ \frac {5 (7 i A+B) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{64 \sqrt {2} a^2 c^{3/2} f}-\frac {5 (7 i A+B)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}-\frac {5 (7 i A+B)}{64 a^2 c f \sqrt {c-i c \tan (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 226, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.140, Rules used = {3669, 79, 44,
53, 65, 214} \begin {gather*} \frac {5 (B+7 i A) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{64 \sqrt {2} a^2 c^{3/2} f}+\frac {-B+i A}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}-\frac {5 (B+7 i A)}{64 a^2 c f \sqrt {c-i c \tan (e+f x)}}-\frac {5 (B+7 i A)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {B+7 i A}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 44
Rule 53
Rule 65
Rule 79
Rule 214
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^3 (c-i c x)^{5/2}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {((7 A-i B) c) \text {Subst}\left (\int \frac {1}{(a+i a x)^2 (c-i c x)^{5/2}} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}+\frac {(5 (7 A-i B) c) \text {Subst}\left (\int \frac {1}{(a+i a x) (c-i c x)^{5/2}} \, dx,x,\tan (e+f x)\right )}{32 a f}\\ &=-\frac {5 (7 i A+B)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}+\frac {(5 (7 A-i B)) \text {Subst}\left (\int \frac {1}{(a+i a x) (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{64 a f}\\ &=-\frac {5 (7 i A+B)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}-\frac {5 (7 i A+B)}{64 a^2 c f \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 A-i B)) \text {Subst}\left (\int \frac {1}{(a+i a x) \sqrt {c-i c x}} \, dx,x,\tan (e+f x)\right )}{128 a c f}\\ &=-\frac {5 (7 i A+B)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}-\frac {5 (7 i A+B)}{64 a^2 c f \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 i A+B)) \text {Subst}\left (\int \frac {1}{2 a-\frac {a x^2}{c}} \, dx,x,\sqrt {c-i c \tan (e+f x)}\right )}{64 a c^2 f}\\ &=\frac {5 (7 i A+B) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{64 \sqrt {2} a^2 c^{3/2} f}-\frac {5 (7 i A+B)}{96 a^2 f (c-i c \tan (e+f x))^{3/2}}+\frac {i A-B}{4 a^2 f (1+i \tan (e+f x))^2 (c-i c \tan (e+f x))^{3/2}}+\frac {7 i A+B}{16 a^2 f (1+i \tan (e+f x)) (c-i c \tan (e+f x))^{3/2}}-\frac {5 (7 i A+B)}{64 a^2 c f \sqrt {c-i c \tan (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.35, size = 204, normalized size = 0.90 \begin {gather*} \frac {e^{-4 i (e+f x)} \left (-i \left (1+e^{2 i (e+f x)}\right ) \left (-i B \left (6+15 e^{2 i (e+f x)}+32 e^{4 i (e+f x)}+8 e^{6 i (e+f x)}\right )+A \left (-6-39 e^{2 i (e+f x)}+80 e^{4 i (e+f x)}+8 e^{6 i (e+f x)}\right )\right )+15 (7 i A+B) e^{4 i (e+f x)} \sqrt {1+e^{2 i (e+f x)}} \tanh ^{-1}\left (\sqrt {1+e^{2 i (e+f x)}}\right )\right ) \sqrt {c-i c \tan (e+f x)}}{384 a^2 c^2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 178, normalized size = 0.79
method | result | size |
derivativedivides | \(-\frac {2 i c^{2} \left (-\frac {\frac {4 \left (-\frac {3 i B}{32}-\frac {11 A}{32}\right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}+4 \left (\frac {13}{16} A c +\frac {5}{16} i B c \right ) \sqrt {c -i c \tan \left (f x +e \right )}}{\left (c +i c \tan \left (f x +e \right )\right )^{2}}+\frac {5 \left (\frac {7 A}{4}-\frac {i B}{4}\right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{4 \sqrt {c}}}{16 c^{3}}-\frac {i B -3 A}{16 c^{3} \sqrt {c -i c \tan \left (f x +e \right )}}-\frac {i B -A}{24 c^{2} \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}}\right )}{f \,a^{2}}\) | \(178\) |
default | \(-\frac {2 i c^{2} \left (-\frac {\frac {4 \left (-\frac {3 i B}{32}-\frac {11 A}{32}\right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}+4 \left (\frac {13}{16} A c +\frac {5}{16} i B c \right ) \sqrt {c -i c \tan \left (f x +e \right )}}{\left (c +i c \tan \left (f x +e \right )\right )^{2}}+\frac {5 \left (\frac {7 A}{4}-\frac {i B}{4}\right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{4 \sqrt {c}}}{16 c^{3}}-\frac {i B -3 A}{16 c^{3} \sqrt {c -i c \tan \left (f x +e \right )}}-\frac {i B -A}{24 c^{2} \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}}\right )}{f \,a^{2}}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 225, normalized size = 1.00 \begin {gather*} -\frac {i \, {\left (\frac {4 \, {\left (15 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{3} {\left (7 \, A - i \, B\right )} - 50 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{2} {\left (7 \, A - i \, B\right )} c + 32 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )} {\left (7 \, A - i \, B\right )} c^{2} + 64 \, {\left (A - i \, B\right )} c^{3}\right )}}{{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {7}{2}} a^{2} - 4 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {5}{2}} a^{2} c + 4 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {3}{2}} a^{2} c^{2}} + \frac {15 \, \sqrt {2} {\left (7 \, A - i \, B\right )} \log \left (-\frac {\sqrt {2} \sqrt {c} - \sqrt {-i \, c \tan \left (f x + e\right ) + c}}{\sqrt {2} \sqrt {c} + \sqrt {-i \, c \tan \left (f x + e\right ) + c}}\right )}{a^{2} \sqrt {c}}\right )}}{768 \, c f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 434 vs. \(2 (188) = 376\).
time = 4.11, size = 434, normalized size = 1.92 \begin {gather*} \frac {{\left (15 \, \sqrt {\frac {1}{2}} a^{2} c^{2} f \sqrt {-\frac {49 \, A^{2} - 14 i \, A B - B^{2}}{a^{4} c^{3} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a^{2} c f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} c f\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {49 \, A^{2} - 14 i \, A B - B^{2}}{a^{4} c^{3} f^{2}}} + 7 i \, A + B\right )} e^{\left (-i \, f x - i \, e\right )}}{32 \, a^{2} c f}\right ) - 15 \, \sqrt {\frac {1}{2}} a^{2} c^{2} f \sqrt {-\frac {49 \, A^{2} - 14 i \, A B - B^{2}}{a^{4} c^{3} f^{2}}} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (-\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a^{2} c f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{2} c f\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {49 \, A^{2} - 14 i \, A B - B^{2}}{a^{4} c^{3} f^{2}}} - 7 i \, A - B\right )} e^{\left (-i \, f x - i \, e\right )}}{32 \, a^{2} c f}\right ) - \sqrt {2} {\left (8 \, {\left (i \, A + B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 8 \, {\left (11 i \, A + 5 \, B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - {\left (-41 i \, A - 47 \, B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (-15 i \, A + 7 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 6 i \, A + 6 \, B\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{384 \, a^{2} c^{2} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {A}{- i c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - i c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} - c \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx + \int \frac {B \tan {\left (e + f x \right )}}{- i c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - i c \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} - c \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.72, size = 353, normalized size = 1.56 \begin {gather*} -\frac {\frac {B\,c^2}{3}-\frac {25\,B\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2}{96}+\frac {5\,B\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3}{64\,c}+\frac {B\,c\,\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}{6}}{a^2\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{7/2}-4\,a^2\,c\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{5/2}+4\,a^2\,c^2\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}-\frac {-\frac {A\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2\,175{}\mathrm {i}}{96\,a^2\,f}+\frac {A\,c^2\,1{}\mathrm {i}}{3\,a^2\,f}+\frac {A\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3\,35{}\mathrm {i}}{64\,a^2\,c\,f}+\frac {A\,c\,\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,7{}\mathrm {i}}{6\,a^2\,f}}{-4\,c\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{5/2}+{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{7/2}+4\,c^2\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}+\frac {\sqrt {2}\,A\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-c}}\right )\,35{}\mathrm {i}}{128\,a^2\,{\left (-c\right )}^{3/2}\,f}+\frac {5\,\sqrt {2}\,B\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {c}}\right )}{128\,a^2\,c^{3/2}\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________